<%@ page import="com.zhuozhengsoft.pageoffice.OpenModeType" %>
<%@ page import="com.zhuozhengsoft.pageoffice.PageOfficeCtrl" %><%--
  Created by IntelliJ IDEA.
  User: My
  Date: 2018/11/8
  Time: 11:28
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<% System.out.println("word method");
    PageOfficeCtrl poCtrl = new PageOfficeCtrl(request);
    String id = request.getParameter("id");
    poCtrl.setServerPage(request.getContextPath() + "/poserver.zz");//设置服务页面
    /*标题栏*/
    poCtrl.setCustomMenuCaption("我的菜单");//添加自定义菜单
    poCtrl.addCustomMenuItem("显示痕迹", "OnCustomMenuClick", true);
    poCtrl.addCustomMenuItem("隐藏痕迹", "OnCustomMenuClick", true);
    poCtrl.addCustomMenuItem("-", "", true);
    poCtrl.addCustomMenuItem("词条专区", "", false);
    poCtrl.addCustomMenuItem("我信你个鬼,你个坏老头,坏得很!", "OnCustomMenuClick", true);
    /*按钮栏*/
    poCtrl.addCustomToolButton("保存", "Save", 1);//添加自定义保存按钮
    poCtrl.addCustomToolButton("-", "", 0);
    poCtrl.addCustomToolButton("保存为pdf并上传", "mybtn", 7);//添加自定义按钮
    poCtrl.setSaveFilePage("con/save");//设置处理文件保存的请求方法
    poCtrl.setCaption("Are You Fucking Kidding Me !!?");
    //打开word
    poCtrl.webOpen("d:\\test.doc", OpenModeType.docAdmin, "张三");%>
<html>
<head>
    <title>Title</title>
    <script src="https://hanlei525.github.io/layui-v2.4.3/layui-v2.4.5/layui.js"></script>
    <link src="https://hanlei525.github.io/layui-v2.4.3/layui-v2.4.5/css/layui.css">
</head>
<body>
<script type="text/javascript">
    function Save() {
        document.getElementById("PageOfficeCtrl1").WebSave();
        var attribute = document.getElementById("thisId").getAttribute("value");
        alert(attribute)
    }

    function mybtn() {
        // document.getElementById("PageOfficeCtrl1").Alert( "瞎点个啥?你要干啥!?" )
        document.getElementById("PageOfficeCtrl1").WebSaveAsPDF();
    }

    function OnCustomMenuClick(iIndex, sCaption) {
        var PageOfficeCtrl1 = document.getElementById("PageOfficeCtrl1");
        alert(sCaption)
        if (iIndex == 0) {
            var appObj = document.getElementById("PageOfficeCtrl1").WordInsertComment();
        }
        if (iIndex == 1) {
            // PageOfficeCtrl1.ShowRevisions = false;
            alert(1)
        }
    }

</script>
<div>
    <<input id = "thisId" type="hidden" value=" <%= id %>">
    <%= poCtrl.getHtmlCode("PageOfficeCtrl1")%>
</div>


</body>
</html>
